var page = require('webpage').create();

page.onUrlChanged = function (url) {
    console.log(url);
    console.log(page.url);
}

page.open('http://www.baidu.com', function () {
    page.includeJs('https://unpkg.com/jquery@3.2.1', function () {
        page.evaluate(function () {
            $("#kw").val("python");
            $("#su").click();
        });
        phantom.exit();
    });
});
